import time


def log(fn):
    def wrapper(*args, **kw):
        print("call %s()" % fn.__name__)
        b_time = time.perf_counter()
        re = fn(*args, **kw)
        e_time = time.perf_counter()
        print("execute %s() cost %s ms" % (fn.__name__, (e_time - b_time)))

        return re

    return wrapper


@log
def hello():
    print("hello world")


hello()
